define(()=>{
    return function(data,id,cb){
        let i = 0;
        data.some((val,idx)=>{
            i = idx;
            return val.id == id;
        })
        cb(i);
        localStorage.setItem("goods", JSON.stringify(data));
    }
})